﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/teleweb/common/global.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中国通信服务</title>
<link href="teleweb/css/ztf.css" rel="stylesheet" type="text/css" />
<link href="teleweb/css/roll.css" rel="stylesheet" type="text/css" />
<link href="teleweb/css/content.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<script>
function validateSubmitForm(form){
	var value = form.question.value;
    var size = value.replace(/[\u4e00-\u9fa5]/g," ").length;
    if(size>=1000) {
		alert("问题内容不能超过1000个汉字!");
		return false;
    }
	value = form.answer.value;
    size = value.replace(/[\u4e00-\u9fa5]/g," ").length;
    if(size>=1000) {
		alert("答复内容不能超过1000个汉字!");
		return false;
    }
    
return true;
}
</script>
<s:form action ="questionanswer-save.action" method ="post" enctype ="multipart/form-data" id="saveQuestionAnswerForm" onsubmit="return validateSubmitForm(this);" > 
<s:hidden name="id"/>
<s:hidden name="status"/>
<s:hidden name="userIp"/>

<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <!-- 主体table -->
  <%request.setAttribute("panel","QA");%>
  <%@ include file="/teleweb/common/include/header.jsp" %>
        
  <tr>
    <!---首页内容--->
    <td class="new_indexcontent">
    <div class="new_stars">
    <div class="new_weizhi">你现在所在的位置：<a href="${ctx}/index">首页</a>><a href="${ctx}/listQuestionAnswer.action">员工问答</a></div>
    </div>
    <!---圆角--->
    <div class="box-cir3">
			<div class="t_l"></div>
			<div class="t_m"></div>
			<div class="t_r"></div>
			<div class="m_l"></div>
			<div class="m_m1">
    <!---标题内容--->
			<div class="new_heading1">
            <h3>问题</h3>
            </div>
			<div class="new_textform">
			 <center><font color="red"><s:actionmessage/><s:actionerror/></font></center>
            <table cellpadding="0" cellspacing="0">
            <tr>
            <td class="new_textlable"><span class="new_lable">提交日期</span><span class="new_redstar">*</span>
            </td>
            <td>
            <input class="Wdate" type="text" name="submitDate" value="${fn:substring(submitDate, 0, 16)}" id="pubdate" style="padding-left:4px;width:150" onClick="WdatePicker({skin:'YcloudRed',dateFmt:'yyyy-MM-dd HH:mm'})">
            
            	     </td>
            </tr>
            <tr>
            <td class="new_textlable"><span class="new_lable">提交IP</span><span class="new_redstar">*</span>
            </td>
            <td><input type="text" class="new_text" name="userIp" value="${userIp}" disabled/>
            </td>
            </tr>
            <tr>
            <td class="new_textlable new_textarea" valign="top"><span class="new_lable">问题</span><span class="new_redstar">*</span>
            </td>
            <td><textarea id="question" name ="question" class="new_text">${question}</textarea> 
            </td>
            </tr>          
            </table>  
            </div>            
			<div class="new_heading1 new_heading2">
            <h3>答复</h3>
            </div>
			<div class="new_textform">
            <table cellpadding="0" cellspacing="0">
            <tr>
            <td class="new_textlable"><span class="new_lable">发布日期</span><span class="new_redstar">*</span>
            </td>
            <td>
            <input class="Wdate" type="text" name="publishDate" value="${fn:substring(publishDate, 0, 16)}" id="pubdate" style="padding-left:4px;width:150" onClick="WdatePicker({skin:'YcloudRed',dateFmt:'yyyy-MM-dd HH:mm'})">
            
            </td>
            </tr>
            
            <tr>
            <td class="new_textlable new_textarea" valign="top"><span class="new_lable">答复</span><span class="new_redstar">*</span>
            </td>
            <td>
            	<textarea id="answer" name ="answer"  class="new_text">${answer}</textarea> 
            </td>
            </tr>          
            <tr>
            <td>
            </td>
            <td>
    <div class="new_btform">
    <c:if test="${qa!=null && qa.status==0}">
    	<script> 
	    	function submitPublish(form){
	    	    if(!confirm("确定发布吗?")) return false;
	    		form.action="${ctx}/questionanswer-publish.action";
	    		form.submit();
	    		return true;
	    	}
	    	function submitSave(form){
	    	    if(!confirm("确定暂存吗?")) return false;
	    	    form.submit();
	    		return true;
	    	}
    	</script>
		<button class="new_btforml" onclick="return submitPublish(document.getElementById('saveQuestionAnswerForm'));">发布</button>
	    <button class="new_btforml" onclick="return submitSave(document.getElementById('saveQuestionAnswerForm'));">暂存</button>
	    <button onclick="document.getElementById('saveQuestionAnswerForm').reset();">重置</button>
    </c:if>
    <c:if test="${qa!=null && qa.status==1}">
    	<script> 
	    	function submitSave(form){
	    	    if(!confirm("确定保存吗?")) return false;
	    	    form.submit();
	    		return true;
	    	}
    	</script>
	    <button class="new_btforml" onclick="return submitSave(document.getElementById('saveQuestionAnswerForm'));">保存</button>
	    <button onclick="document.getElementById('saveQuestionAnswerForm').reset();">重置</button>
    </c:if>
    
    </div>
            </td>
            </tr>
            </table>  
            </div>            
			</div>
			<div class="m_r"></div>
			<div class="b_l"></div>
			<div class="b_m"></div>
			<div class="b_r"></div>
		</div>
    </td>
  </tr>
  <%@ include file="common/include/tail.jsp"%>
</table>
 </s:form > 
</body>
</html>
